package com.wanxi.list;

import java.util.LinkedList;
import java.util.List;

public class MyLinkedList {
    public static void main(String[] args) {
        LinkedList<String> list = new LinkedList<>();
        list.add("a");
        list.add("b");
        list.add("d");
        list.add("c");
        list.add(2, "e");
        list.addFirst("t");
        list.addLast("p");
        String s = list.removeLast();
        System.out.println(s);
        for (int i = 0; i < list.size(); i++) {
            System.out.print(list.get(i) + "  ");
        }
    }
}
